﻿using ACGN.MVC.Models.Newsflashss;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ACGN.Core.Models;
using AutoMapper;
using ACGN.MVC.Models.Productss;
using ACGN.MVC.Models.ProPicturess;

namespace ACGN.MVC.Models
{
    public class ServiceProfile:Profile
    {
       public ServiceProfile()
        {
            CreateMap<Newsflash, NewsflashViewModel>()
               .ForMember(dest => dest.NFTName, opt => opt.MapFrom(stu => stu.NfType.NFTName))
               .ReverseMap();
            CreateMap<Product, ProductViewModel>()
              .ForMember(dest => dest.TName, opt => opt.MapFrom(stu => stu.ProType.TName))
              .ReverseMap();
            CreateMap<ProPicture, ProPictureViewModel>()
              .ForMember(dest => dest.PName, opt => opt.MapFrom(stu => stu.Product.PName))
              .ReverseMap();
        }
    }
}
